﻿' The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
Imports Runa.Core.GamePackage

''' <summary>
''' An empty page that can be used on its own or navigated to within a Frame.
''' </summary>
Public NotInheritable Class LoadingPage
    Inherits Page

    ''' <summary>
    ''' Invoked when this page is about to be displayed in a Frame.
    ''' </summary>
    ''' <param name="e">Event data that describes how this page was reached.  The Parameter
    ''' property is typically used to configure the page.</param>
    Protected Overrides Async Sub OnNavigatedTo(e As Navigation.NavigationEventArgs)
        Me.TrLogo.Begin()
        AddHandler Me.LayerOut.Completed,
            Sub(sender, a)
                Me.Frame.Navigate(GetType(MainPage))
            End Sub
        Await InitialzeAsync()
        Me.LayerOut.Begin()
    End Sub

    Public Async Function InitialzeAsync() As Task
        Await Task.Run(
            Sub()
                Task.Delay(3000)
                Helper.g_gameList = GetGames()
            End Sub)
    End Function

End Class